﻿using Inovout.Cloud.Models;
using Inovout.Services;
using Inovout.Web.Mvc;

namespace Inovout.Cloud.Web.Mvc
{
    public class CloudController<T> : RepositoryController<T> where T : class
    {
        protected Project Project { get; private set; }
        protected override void Initialize()
        {
            string projectId;
            if (base.TryGetParameterValue("projectId",out projectId))
            {
                Project = ComponentRegistry.Resolve<IRepositoryService<Project>>().FindById(int.Parse(projectId));
                ViewBag.Project = Project;
            }
            base.Initialize();
        }
    }
}
